package com.sxf.controller;

import java.util.Map;

import javax.servlet.http.HttpServletRequest;

import org.springframework.web.bind.WebDataBinder;
import org.springframework.web.bind.annotation.InitBinder;
import org.springframework.web.servlet.ModelAndView;
import org.springframework.web.servlet.mvc.multiaction.MultiActionController;

import com.sxf.common.tools.NativeThreadLocal;
import com.sxf.common.tools.WPConstants;
import com.sxf.domain.viewbean.UserVO;

/**
 * 主类方法
 * 
 * @author phsxf01
 */
public class SuperController extends MultiActionController {

	@InitBinder
	public void initBinder(WebDataBinder binder) {
		// binder.registerCustomEditor(Date.class, new DateConvertEditor());
		// binder.registerCustomEditor(String.class, new
		// StringTrimmerEditor(true));
	}

	/**
	 * 返回ModelAndView
	 * 
	 * @param map
	 * @param viewName
	 * @return
	 */
	public ModelAndView getModelAndView(Map<String, Object> map, String viewName) {
		ModelAndView mav = new ModelAndView(viewName, map);
		return mav;
	}
	
	public UserVO getCurrentUser() {
		return (UserVO) NativeThreadLocal.get();
	}
}
